//package com.zmn.plat.dubbo.impl.product;
//
//import javax.annotation.Resource;
//
//import org.apache.dubbo.config.annotation.Service;
//import org.springframework.cache.annotation.CacheConfig;
//
//import com.zmn.common.dto2.ResponseDTO;
//import com.zmn.common.utils.date.DateUtil;
//import com.zmn.plat.common.dto.product.BaseCodeMapDIO;
//import com.zmn.plat.common.dto.product.BaseCodeMapDRO;
//import com.zmn.plat.dubbo.interfaces.product.BaseCodeMapModifyRemoteService;
//import com.zmn.plat.dubbo.utils.DubboConsts;
//import com.zmn.plat.model.entity.product.BaseCodeMap;
//import com.zmn.plat.services.interfaces.product.BaseCodeMapService;
//import com.zmn.plat.utils.bean.BeanCopyUtils;
//
///**
// * @author tanghongjun
// * @version v1.0 @类说明：
// * @since 2018/10/16 11:30
// */
//@Service(loadbalance = "roundrobin", timeout = 5000, retries = -1, version = DubboConsts.INTERFACE_VERSION, validation = "true")
//@CacheConfig(cacheNames = "redis1h")
//public class BaseCodeMapModifyRemoteServiceImpl implements BaseCodeMapModifyRemoteService {
//
//    @Resource
//    private BaseCodeMapService baseCodeMapService;
//
//    @Override
//    public ResponseDTO<BaseCodeMapDRO> add(BaseCodeMapDIO baseCodeMapDIO) {
//        BaseCodeMap baseCodeMap = new BaseCodeMap();
//        BeanCopyUtils.copyProperties(baseCodeMapDIO, baseCodeMap);
//        baseCodeMap.setCreateTime(DateUtil.getNow());
//        baseCodeMapService.insert(baseCodeMap);
//
//        return this.returnDRO(baseCodeMap);
//    }
//
//    @Override
//    public ResponseDTO<BaseCodeMapDRO> modifyByKey(BaseCodeMapDIO baseCodeMapDIO) {
//        BaseCodeMap baseCodeMap = new BaseCodeMap();
//        BeanCopyUtils.copyProperties(baseCodeMapDIO, baseCodeMap);
//        baseCodeMap.setUpdateTime(DateUtil.getNow());
//        baseCodeMapService.updateByKey(baseCodeMap);
//
//        return this.returnDRO(baseCodeMap);
//    }
//
//    private ResponseDTO<BaseCodeMapDRO> returnDRO(BaseCodeMap baseCodeMap) {
//        BaseCodeMapDRO baseCodeMapDRO = new BaseCodeMapDRO();
//        BeanCopyUtils.copyProperties(baseCodeMap, baseCodeMapDRO);
//
//        return ResponseDTO.success(baseCodeMapDRO, "OK");
//    }
//}
